package com.black.service.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

/**
 * @author ylx
 */
@Data
@TableName("resource")
public class ResourceEntity {
    @TableId
    private String resourceId;
    private String resourceType;
    private String resourceName;
    private String resourceUrl;
    private int resourceSize;
    @TableField(fill = FieldFill.INSERT)
    private String createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateTime;
    @TableField(exist = false)
    private byte[] resourceData;

    public void setResourceData(byte[] resourceData) {
        this.resourceData = resourceData;
        this.resourceSize = resourceData.length;
    }
}
